package com.foreknow.demo5;

public class Employee {
    String name;
    int age;
    double salary;
    public Employee(){
        this("JONE DOE",18,200);
    }
    public  Employee(String name,int age,double salry){
        this.name = name;
        this.age = age;
        this.salary = salry;

    }
    public String getName(){
        return name;
    }
    public int getAge(){
        return age;
    }
    public void updateName(String name){
        this.name = name;
    }
    public double getSalary(){
        return salary;
    }

    public static void main(String[] args) {
//        Employee e1 = new Employee();
//        System.out.println(e1.getName());
//        System.out.println(e1.getAge());
//        System.out.println(e1.getSalary());
//        e1.name = "zhangsan";
//        e1.age = 25;
//        e1.salary = 8888.88;
//        System.out.println(e1.getName());
//        System.out.println(e1.getAge());
//        System.out.println(e1.getSalary());
//        Employee e2 = new Employee();
//        e2.name = "lisi";
//        e2.age = 21;
//        e2.salary = 9999.99;
//        System.out.println(e2.getName());
//        System.out.println(e2.getAge());
//        System.out.println(e2.getSalary());
        Employee e1 = new Employee();
        e1.name  = "feiyy";
        e1.updateName("james");
        System.out.println(e1.name);
        System.out.println(e1.getName());
        Employee e2 = new Employee("maomian",22,888.88);
        System.out.println(e2.name);
        System.out.println(e2.age);
        System.out.println(e2.salary);
    }
}
